package com.allenkerr.app;

import com.allenkerr.client.cxf.HelloCxfWebService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by 小柯(Allen Kerr) on 17.5.16 14:10.
 */
public class HelloCxfAppOnSpring {

    public static void main(String[] args) {
        //读取spring配置文件，创建spring工厂，从工厂中获取代理对象，实现远程调用
        ApplicationContext ctx = new ClassPathXmlApplicationContext("cxf-client.xml");
        HelloCxfWebService proxy = (HelloCxfWebService) ctx.getBean("myClient");
        String result = proxy.sayHello("CXF with Spring !!!");//中文还是乱码！
        System.out.println(result);
    }

}
